import request from '@/config/axios'

// 灵境币充值套餐 VO
export interface PointPlanVO {
  id: number // 编号
  planName: string // 充值套餐
  price: number // 实际支付金额
  rechargePoint: number // 到账灵境币
  iosRechargePoint: number // ios到账灵境币
  discountRate: number // 折扣比例
  status: number // 状态
  sort: number // 排序
  description: string // 套餐描述
}

// 灵境币充值套餐 API
export const PointPlanApi = {
  // 查询灵境币充值套餐分页
  getPointPlanPage: async (params: any) => {
    return await request.get({ url: `/member/point-plan/page`, params })
  },

  // 查询灵境币充值套餐详情
  getPointPlan: async (id: number) => {
    return await request.get({ url: `/member/point-plan/get?id=` + id })
  },

  // 新增灵境币充值套餐
  createPointPlan: async (data: PointPlanVO) => {
    return await request.post({ url: `/member/point-plan/create`, data })
  },

  // 修改灵境币充值套餐
  updatePointPlan: async (data: PointPlanVO) => {
    return await request.put({ url: `/member/point-plan/update`, data })
  },

  // 删除灵境币充值套餐
  deletePointPlan: async (id: number) => {
    return await request.delete({ url: `/member/point-plan/delete?id=` + id })
  },

  // 导出灵境币充值套餐 Excel
  exportPointPlan: async (params) => {
    return await request.download({ url: `/member/point-plan/export-excel`, params })
  },
}